﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Miris.HumanMilkAnalyser.DataModel;

namespace Miris.HumanMilkAnalyser.Repository.EntityFramework.Mapping
{
    public class BreastfeedingSignificanceMap : EntityTypeConfiguration<BreastfeedingSignificance>
    {
        public BreastfeedingSignificanceMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Title)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.SignificanceContent)
                .IsRequired();

            // Table & Column Mappings
            this.ToTable("BreastfeedingSignificance");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.SignificanceContent).HasColumnName("SignificanceContent");
        }
    }
}
